<template>
  <div>
    <el-table v-loading="loading" :data="postList">
      <el-table-column label="交易流水号" align="center" prop="transId"/>
      <el-table-column label="余额" align="center" prop="bal"/>
      <el-table-column label="交易余额" align="center" prop="transAmt"/>
      <el-table-column label="交易类型" align="center" prop="transType" :formatter="typeFormatter"/>
      <el-table-column label="交易日期" align="center" prop="transTime">
        <template slot-scope="scope">
          <span>{{scope.row.transTime|converStrToDateFilter}}</span>
        </template>
      </el-table-column>
      <el-table-column label="备注" align="center" prop="remark"/>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNo"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
  import {platformList} from "@/api/main/financial/fund";
  export default {
    data(){
      return {
        total:0,
        loading:false,
        postList:[],
        typeOptions:[{'dictLabel':'支出','dictValue':1},{'dictLabel':'收入','dictValue':2}],
        queryParams:{
          pageNo:1,
          pageSize:10,
          acctType:'12'
        }
      }
    },
    created() {
      this.getList();


    },
    methods:{
      getList(){
        this.loading=true;
        platformList(this.queryParams).then(response=>{
          this.total=Number(response.data.totalRecord);
          this.postList=response.data.dataList;
          this.loading=false;
        });
      },
      typeFormatter(row){
        return this.selectDictLabel(this.typeOptions, row.transType);
      }
    }
  }
</script>


<style scoped>
</style>
